home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / CD CHIP.ISO / Vari / Multimed / 95ITERAT / _SETUP.1 / Realwrl2.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-19  |  30.1 KB  |  1,606 lines

  1. ///////////////////////////////////////////////
  2. // Real World Fractals 2
  3.  
  4. #include "stdafx.h"
  5. #include "itriazon.h"
  6. #include "itriadoc.h"
  7. #include "itriavw.h"
  8. #include "external.h"
  9. #include "rw1.h"
  10. #include "rw2.h"
  11. #include "math.h"
  12. #include "convolut.h"
  13. #include "nthorder.h"
  14. #include "post.h"
  15. #include "orient.h"
  16. #include "filter12.h"
  17.  
  18. ////////////////////////////////////////////////////////////
  19. // Real World equations start here
  20. ////////////////////////////////////////////////////////////
  21.  
  22. void CIterationsView::RealWorld2()
  23. {    
  24.     switch (nDistortion)
  25.     {
  26.         case 16:
  27.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  28.             {
  29.                 z = (z*c).ccos()*c;
  30.              if (nFilter) Delta_z(z.real(), z.imaginary());
  31.             }
  32.             if (nFilter) Filter_Complete();
  33.             break;
  34.  
  35.         case 22:
  36.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  37.             {
  38.                 z = (z^rn) - (c^rm);
  39.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  40.             }
  41.             if (nFilter) Filter_Complete();
  42.             break;
  43.  
  44.         case 23:
  45.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  46.             {
  47.                 z = (z^rn) + (z^rm) + c;
  48.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  49.             }
  50.             if (nFilter) Filter_Complete();
  51.             break;
  52.  
  53.         case 24:
  54.             // Barnsley
  55.             // if ((z.r * c.i + c.r * z.i) >= 0) F(z) = z*c-c; else F(z) = z*c+c;
  56.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  57.             {
  58.                 if (z.real()*c.imaginary() + c.real()*z.imaginary() >= 0)
  59.                     z = z*c - c;
  60.                 else
  61.                     z = z*c + c;
  62.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  63.             }
  64.             if (nFilter) Filter_Complete();
  65.             break;
  66.  
  67.         case 25:
  68.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  69.             {
  70.                 //z = z*sin(z.real()) + c*z*cos(z.imag()) + c;
  71.                 z = c*z*sin(z.real()) + c*z*cos(z.imag()) + c;
  72.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  73.             }
  74.             if (nFilter) Filter_Complete();
  75.             break;
  76.  
  77.         case 26:
  78.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  79.             {
  80.                 z = (z^rn) - z + c;
  81.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  82.             }
  83.             if (nFilter) Filter_Complete();
  84.             break;
  85.  
  86.         case 27:
  87.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  88.             {
  89.                 z = z.ccos() + c;                
  90.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  91.             }
  92.             if (nFilter) Filter_Complete();
  93.             break;
  94.  
  95.         case 28:
  96.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  97.             {
  98.                 z = (z^rn)*sin(z.real()) + c*z*cos(z.imaginary()) + c;
  99.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  100.             }
  101.             if (nFilter) Filter_Complete();
  102.             break;
  103.  
  104.         case 29:
  105.             // Spider
  106.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  107.             {   
  108.                 z = (z^rn) + c;
  109.                 c = c/2 + z;                    
  110.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  111.             }
  112.             if (nFilter) Filter_Complete();
  113.             break;
  114.  
  115.         case 30:
  116.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  117.             {
  118.                 z = ((z^5) + c) / ((z^3) + (z^2) + z + 1);
  119.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  120.             }
  121.             if (nFilter) Filter_Complete();
  122.             break;
  123.  
  124.         case 31:
  125.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  126.             {
  127.                 z = (z^9) - c*(z^6) + c*(z^3) + c;
  128.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  129.             }
  130.             if (nFilter) Filter_Complete();
  131.             break;
  132.  
  133.         case 32:
  134.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  135.             {
  136.                 z = (z^rn)*sin(z.real()) + 
  137.                         c*z.imaginary()*z +
  138.                         (z^rm)*cos(z.real()) +
  139.                         c*z*sin(z.imaginary()) + c;
  140.  
  141.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  142.             }
  143.             if (nFilter) Filter_Complete();
  144.             break;
  145.  
  146.         case 33:
  147.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  148.             {
  149.                 z = c*(z.csin() + z.ccos()) * ((z^3) + z + c);
  150.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  151.             }
  152.             if (nFilter) Filter_Complete();
  153.             break;
  154.  
  155.         case 34:
  156.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  157.             {
  158.                 z = z*z*(cmplx(expo,0)^z) - z*(cmplx(expo,0)^z) + c;
  159.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  160.             }
  161.             if (nFilter) Filter_Complete();
  162.             break;
  163.  
  164.         case 35:
  165.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  166.             {
  167.                 z = c*(z.csin() + z.ccos());
  168.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  169.             }
  170.             if (nFilter) Filter_Complete();
  171.             break;
  172.  
  173.         case 36:
  174.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  175.             {
  176.                 z = (z^rn).cexp()/((z^rm)+c);
  177.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  178.             }
  179.             if (nFilter) Filter_Complete();
  180.             break;
  181.  
  182.         case 37:
  183.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  184.             {
  185.                 z = (z^12)*cos(z.real()) - 
  186.                         (z^11)*sin(z.imaginary()) - 
  187.                         (z^10)*tan(z.imaginary()) + c;
  188.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  189.             }
  190.             if (nFilter) Filter_Complete();
  191.             break;
  192.  
  193.         case 38:
  194.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  195.             {
  196.                 z = (z^12) - (z^11) - (z^10) + c;
  197.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  198.             }
  199.             if (nFilter) Filter_Complete();
  200.             break;
  201.  
  202.         case 39:
  203.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  204.             {
  205.                 z = (z^rn) + c;
  206.                 z = z.csin();
  207.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  208.             }
  209.             if (nFilter) Filter_Complete();
  210.             break;
  211.  
  212.         case 40:
  213.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  214.             {
  215.                 z = (z^rn) + c;
  216.                 z = z.cexp();
  217.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  218.             }
  219.             if (nFilter) Filter_Complete();
  220.             break;
  221.  
  222.         case 41:
  223.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  224.             {
  225.                 z = (z^pi) + (c^pi);
  226.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  227.             }
  228.             if (nFilter) Filter_Complete();
  229.             break;
  230.  
  231.         case 42:
  232.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  233.             {
  234.                 z = ((((z^cn) + 1))^.5) + c;
  235.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  236.             }
  237.             if (nFilter) Filter_Complete();
  238.             break;
  239.  
  240.         case 43:
  241.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  242.             {
  243.                 z = ((z^4) + c)^.5;
  244.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  245.             }
  246.             if (nFilter) Filter_Complete();
  247.             break;
  248.  
  249.         case 44:
  250.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  251.             {
  252.                 z = cmplx(expo,0)^((z*c).ccos());
  253.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  254.             }
  255.             if (nFilter) Filter_Complete();
  256.             break;
  257.  
  258.         case 45:
  259.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  260.             {
  261.                 z = c*z - 1 + c*(cmplx(expo,expo))^(-z);
  262.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  263.             }
  264.             if (nFilter) Filter_Complete();
  265.             break;
  266.  
  267.         case 46:
  268.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  269.             {
  270.                 z = 1/((z*z) + c);
  271.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  272.             }
  273.             if (nFilter) Filter_Complete();
  274.             break;
  275.  
  276.         case 47:
  277.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  278.             {
  279.                 z = 2/(z*z + (c^rn));
  280.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  281.             }
  282.             if (nFilter) Filter_Complete();
  283.             break;
  284.  
  285.         case 48:
  286.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  287.             {
  288.                 z = z*z*(z*z).cexp() + c;
  289.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  290.             }
  291.             if (nFilter) Filter_Complete();
  292.             break;
  293.  
  294.         case 49:
  295.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  296.             {
  297.                 //z = (z*z + c)^2 + c;
  298.                 z = (z*z+c)^(2+c);
  299.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  300.             }
  301.             if (nFilter) Filter_Complete();
  302.             break;
  303.  
  304.         case 50:
  305.         for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
  306.             {
  307.                 z = z*z + (z*c).csin() + c;
  308.                 if (nFilter) Delta_z(z.real(), z.imaginary());
  309.             }
  310.             if (nFilter) Filter_Complete();
  311.             break;
  312.  
  313.         default:
  314.             AfxMessageBox("Real World Fractals, shouldn't get here...");
  315.             break;
  316.     }
  317. }
  318.  
  319. void CIterationsView::OnViewOrbits() 
  320. {
  321.     bNewView = FALSE;
  322.     bOrbits = TRUE;
  323.     bDraw = TRUE;
  324.     bLaunch = FALSE;
  325.     if (!nFilter)
  326.         nFilter = 28;
  327.     GoDoFractal();
  328. }
  329.  
  330. void CIterationsView::OnUpdateViewOrbits(CCmdUI* pCmdUI) 
  331. {
  332.     if (CRMIN_NEW < CRMAX_NEW && CIMIN_NEW < CIMAX_NEW)
  333.         pCmdUI->Enable(TRUE);
  334.     else
  335.         pCmdUI->Enable(FALSE);
  336.     pCmdUI->SetCheck(bOrbits);
  337. }
  338.            
  339. void CIterationsView::OnFractalsNofilter()
  340. {
  341.     nFilter                =    0;
  342.     bFilter14            =    FALSE;
  343.     bFilter21            =    FALSE;
  344.     bFilter22            =    FALSE;
  345.     bFilter26            =    FALSE;
  346.     bFilter31            =    FALSE;
  347.     bFilter32            =    FALSE;
  348.     bFilter33            =    FALSE;
  349.     bFilter34            =    FALSE;
  350.     bFilter35            =    FALSE;
  351.     bFilter36            =    FALSE;
  352.     bFilter37            =    FALSE;
  353.     bFilter38            =    FALSE;
  354.     bMFilter            =    FALSE;
  355.     bQuickMode        = FALSE;
  356.     bGeometry            = FALSE;
  357.     GoDoFractal();
  358. }
  359.  
  360. void CIterationsView::OnUpdateFractalsNofilter(CCmdUI* pCmdUI)
  361. {
  362.     if (nFilter == 0)
  363.         pCmdUI->SetCheck(TRUE);
  364.     else
  365.         pCmdUI->SetCheck(FALSE);
  366. }
  367.  
  368. void CIterationsView::OnFractals1filter()
  369. {
  370.     nFilter=1;
  371.     GoDoFractal();
  372. }
  373.  
  374. void CIterationsView::OnUpdateFractals1filter(CCmdUI* pCmdUI)
  375. {
  376.     if (nFilter == 1)
  377.         pCmdUI->SetCheck(TRUE);
  378.     else
  379.         pCmdUI->SetCheck(FALSE);
  380. }
  381.  
  382. void CIterationsView::OnFractals2filter()
  383. {
  384.     nFilter=2;
  385.     GoDoFractal();
  386. }
  387.  
  388. void CIterationsView::OnUpdateFractals2filter(CCmdUI* pCmdUI)
  389. {
  390.     if (nFilter == 2)
  391.         pCmdUI->SetCheck(TRUE);
  392.     else
  393.         pCmdUI->SetCheck(FALSE);
  394. }
  395.  
  396. void CIterationsView::OnFractals3filter()
  397. {
  398.     nFilter=3;
  399.     GoDoFractal();
  400. }
  401.  
  402. void CIterationsView::OnUpdateFractals3filter(CCmdUI* pCmdUI)
  403. {
  404.     if (nFilter == 3)
  405.         pCmdUI->SetCheck(TRUE);
  406.     else
  407.         pCmdUI->SetCheck(FALSE);
  408. }
  409.  
  410. void CIterationsView::OnFractals4filter()
  411. {
  412.     nFilter=4;
  413.     GoDoFractal();
  414. }
  415.  
  416. void CIterationsView::OnUpdateFractals4filter(CCmdUI* pCmdUI)
  417. {
  418.     if (nFilter == 4)
  419.         pCmdUI->SetCheck(TRUE);
  420.     else
  421.         pCmdUI->SetCheck(FALSE);
  422. }
  423.  
  424. void CIterationsView::OnFractals5filter()
  425. {
  426.     nFilter=5;
  427.     GoDoFractal();
  428. }
  429.  
  430. void CIterationsView::OnUpdateFractals5filter(CCmdUI* pCmdUI)
  431. {
  432.     if (nFilter == 5)
  433.         pCmdUI->SetCheck(TRUE);
  434.     else
  435.         pCmdUI->SetCheck(FALSE);
  436. }
  437.  
  438. void CIterationsView::OnFRACTALS6Filter() 
  439. {
  440.     nFilter=6;
  441.     GoDoFractal();
  442. }
  443.  
  444. void CIterationsView::OnUpdateFRACTALS6Filter(CCmdUI* pCmdUI) 
  445. {
  446.     if (nFilter == 6)
  447.         pCmdUI->SetCheck(TRUE);
  448.     else
  449.         pCmdUI->SetCheck(FALSE);
  450. }
  451.     
  452. void CIterationsView::OnFractals7filter() 
  453. {
  454.     nFilter = 7;
  455.     GoDoFractal();
  456. }
  457.  
  458. void CIterationsView::OnUpdateFractals7filter(CCmdUI* pCmdUI) 
  459. {
  460.     if (nFilter == 7)
  461.         pCmdUI->SetCheck(TRUE);
  462.     else
  463.         pCmdUI->SetCheck(FALSE);
  464. }
  465.  
  466. void CIterationsView::OnFractals8filter() 
  467. {
  468.     nFilter = 8;
  469.     GoDoFractal();
  470. }
  471.  
  472. void CIterationsView::OnUpdateFractals8filter(CCmdUI* pCmdUI) 
  473. {
  474.     if (nFilter == 8)    pCmdUI->SetCheck(TRUE);
  475.     else pCmdUI->SetCheck(FALSE);
  476. }
  477.  
  478. void CIterationsView::OnFractals9filter() 
  479. {
  480.     nFilter = 9;
  481.     GoDoFractal();
  482. }
  483.  
  484. void CIterationsView::OnUpdateFractals9filter(CCmdUI* pCmdUI) 
  485. {
  486.     if (nFilter == 9)    pCmdUI->SetCheck(TRUE);
  487.     else pCmdUI->SetCheck(FALSE);
  488. }
  489.  
  490. void CIterationsView::OnFractals10filter() 
  491. {
  492.     nFilter = 10;
  493.     GoDoFractal();
  494. }
  495.  
  496. void CIterationsView::OnUpdateFractals10filter(CCmdUI* pCmdUI) 
  497. {
  498.     if (nFilter == 10)    pCmdUI->SetCheck(TRUE);
  499.     else pCmdUI->SetCheck(FALSE);
  500. }
  501.  
  502. void CIterationsView::OnFractals11filter() 
  503. {
  504.     nFilter = 11;
  505.     GoDoFractal();
  506. }
  507.  
  508. void CIterationsView::OnUpdateFractals11filter(CCmdUI* pCmdUI) 
  509. {
  510.     if (nFilter == 11)    pCmdUI->SetCheck(TRUE);
  511.     else pCmdUI->SetCheck(FALSE);
  512. }
  513.  
  514. void CIterationsView::OnFilters12filter() 
  515. {
  516.     if (!bFilter_12)
  517.     {
  518.         CFilter12 cf12;
  519.         cf12.m_Power  = dFilter_12Power;
  520.         cf12.m_Magnif = dFilter_12Magnif;
  521.         if (cf12.DoModal() == IDOK)
  522.         {
  523.             dFilter_12Power  = cf12.m_Power;
  524.             dFilter_12Magnif = cf12.m_Magnif;
  525.             bFilter_12 = TRUE;;
  526.             GoDoFractal();
  527.         }
  528.     }
  529.     else
  530.     {
  531.         bFilter_12 = FALSE;
  532.         GoDoFractal();
  533.     }
  534. }
  535.  
  536. void CIterationsView::OnUpdateFilters12filter(CCmdUI* pCmdUI) 
  537. {
  538.     pCmdUI->SetCheck(bFilter_12);
  539. }
  540.  
  541. void CIterationsView::OnFilter14() 
  542. {
  543.     if (bFilter14)
  544.     {
  545.         bFilter14 = FALSE;
  546.         if (nFilter == 14)
  547.             nFilter = 0;
  548.     }
  549.     else
  550.     {
  551.         bFilter14 = TRUE;
  552.         bGeometry = TRUE;
  553.         if (nFilter == 0)
  554.             nFilter = 14;
  555.     }
  556.  
  557.     GoDoFractal();
  558. }
  559.  
  560. void CIterationsView::OnUpdateFilter14(CCmdUI* pCmdUI) 
  561. {
  562.     pCmdUI->SetCheck(bFilter14);
  563. }
  564.  
  565. void CIterationsView::OnFilter15() 
  566. {
  567.     nFilter = 15;
  568.     GoDoFractal();
  569. }
  570.  
  571. void CIterationsView::OnUpdateFilter15(CCmdUI* pCmdUI) 
  572. {
  573.     if (nFilter == 15)    pCmdUI->SetCheck(TRUE);
  574.     else pCmdUI->SetCheck(FALSE);
  575. }
  576.  
  577. void CIterationsView::OnFilter16() 
  578. {
  579.     nFilter = 16;
  580.     GoDoFractal();
  581. }
  582.  
  583. void CIterationsView::OnUpdateFilter16(CCmdUI* pCmdUI) 
  584. {
  585.     if (nFilter == 16)    pCmdUI->SetCheck(TRUE);
  586.     else pCmdUI->SetCheck(FALSE);
  587. }
  588.  
  589. void CIterationsView::OnFilter17() 
  590. {
  591.     nFilter = 17;
  592.     GoDoFractal();
  593. }
  594.  
  595. void CIterationsView::OnUpdateFilter17(CCmdUI* pCmdUI) 
  596. {
  597.     if (nFilter == 17)    pCmdUI->SetCheck(TRUE);
  598.     else pCmdUI->SetCheck(FALSE);
  599. }
  600.  
  601. void CIterationsView::OnFilter18() 
  602. {
  603.     nFilter = 18;
  604.     GoDoFractal();
  605. }
  606.  
  607. void CIterationsView::OnUpdateFilter18(CCmdUI* pCmdUI) 
  608. {
  609.     if (nFilter == 18)    pCmdUI->SetCheck(TRUE);
  610.     else pCmdUI->SetCheck(FALSE);
  611. }
  612.  
  613. void CIterationsView::OnFilter19() 
  614. {
  615.     nFilter = 19;
  616.     GoDoFractal();
  617. }
  618.  
  619. void CIterationsView::OnUpdateFilter19(CCmdUI* pCmdUI) 
  620. {
  621.     if (nFilter == 19)    pCmdUI->SetCheck(TRUE);
  622.     else pCmdUI->SetCheck(FALSE);
  623. }
  624.  
  625. void CIterationsView::OnFilter20() 
  626. {
  627.     nFilter = 20;
  628.     GoDoFractal();
  629. }
  630.  
  631. void CIterationsView::OnUpdateFilter20(CCmdUI* pCmdUI) 
  632. {
  633.     if (nFilter == 20)    pCmdUI->SetCheck(TRUE);
  634.     else pCmdUI->SetCheck(FALSE);
  635. }
  636.  
  637. void CIterationsView::OnFilter21double() 
  638. {
  639.     CRMIN      = -4.0;    //        // left
  640.     CIMIN      = -4.0;    //    // top
  641.     CRMAX      =  4.0;    //      // right
  642.     CIMAX      =  4.0;    //      // bottom
  643.  
  644.     if (bFilter21)
  645.     {
  646.         bFilter21 = FALSE;
  647.         if (nFilter == 21)
  648.             nFilter = 0;
  649.     }
  650.     else
  651.     {
  652.         bFilter21 = TRUE;
  653.         bGeometry = TRUE;
  654.         if (nFilter == 0)
  655.             nFilter = 21;
  656.     }
  657.  
  658.     GoDoFractal();
  659. }
  660.  
  661. void CIterationsView::OnUpdateFilter21double(CCmdUI* pCmdUI) 
  662. {
  663.     pCmdUI->SetCheck(bFilter21);
  664. }
  665.  
  666. void CIterationsView::OnFilter22quad() 
  667. {
  668.     CRMIN      = -4.0;    //        // left
  669.     CIMIN      = -4.0;    //    // top
  670.     CRMAX      =  4.0;    //      // right
  671.     CIMAX      =  4.0;    //      // bottom
  672.  
  673.     if (bFilter22)
  674.     {
  675.         bFilter22 = FALSE;
  676.         if (nFilter == 22)
  677.             nFilter = 0;
  678.     }
  679.     else
  680.     {
  681.         bFilter22 = TRUE;
  682.         bGeometry = TRUE;
  683.         if (nFilter == 0)
  684.             nFilter = 22;
  685.     }
  686.  
  687.     GoDoFractal();
  688. }
  689.  
  690. void CIterationsView::OnUpdateFilter22quad(CCmdUI* pCmdUI) 
  691. {
  692.     pCmdUI->SetCheck(bFilter22);
  693. }
  694.  
  695. void CIterationsView::OnFractalBiomorphnone() 
  696. {
  697.     dBiomorph = 0;
  698.     bDraw = TRUE;
  699.     bLaunch = FALSE;
  700. }
  701.  
  702. void CIterationsView::OnFilter23sumof2ndderivative() 
  703. {
  704.     nFilter = 23;
  705.     GoDoFractal();
  706. }
  707.  
  708. void CIterationsView::OnUpdateFilter23sumof2ndderivative(CCmdUI* pCmdUI) 
  709. {
  710.     if (nFilter == 23)    pCmdUI->SetCheck(TRUE);
  711.     else pCmdUI->SetCheck(FALSE);
  712. }
  713.  
  714. void CIterationsView::OnFilter24() 
  715. {
  716.     CRW1 rw;
  717.     rw.m_RW1_n = dF;
  718.     if (rw.DoModal() == IDOK)
  719.     {
  720.         nFilter = 24;
  721.         dF = rw.m_RW1_n;
  722.         GoDoFractal();
  723.     }
  724. }
  725.  
  726. void CIterationsView::OnUpdateFilter24(CCmdUI* pCmdUI) 
  727. {
  728.     if (nFilter == 24)    pCmdUI->SetCheck(TRUE);
  729.     else pCmdUI->SetCheck(FALSE);
  730. }
  731.  
  732. void CIterationsView::OnFilter25() 
  733. {
  734.     CRW1 rw;
  735.     rw.m_RW1_n = dF;
  736.     if (rw.DoModal() == IDOK)
  737.     {
  738.         nFilter = 25;
  739.         dF = rw.m_RW1_n;
  740.         GoDoFractal();
  741.     }
  742. }
  743.  
  744. void CIterationsView::OnUpdateFilter25(CCmdUI* pCmdUI) 
  745. {
  746.     if (nFilter == 25)    pCmdUI->SetCheck(TRUE);
  747.     else pCmdUI->SetCheck(FALSE);
  748. }
  749.  
  750. void CIterationsView::OnFilter26() 
  751. {
  752.     if (!bFilter26)
  753.     {    
  754.         CNthOrder real_order;
  755.         real_order.m_RealNthOrder                = rorder_r;
  756.         real_order.m_ImaginaryNthOrder    = rorder_i;
  757.         if (real_order.DoModal() == IDOK)
  758.         {
  759.             rorder_r = real_order.m_RealNthOrder;    
  760.             rorder_i = real_order.m_ImaginaryNthOrder;    
  761.             bFilter26 = TRUE;
  762.             cFilter26 = cmplx(rorder_r, rorder_i);
  763.             if (!nFilter)
  764.                 nFilter = 26;
  765.             bGeometry = TRUE;
  766.             GoDoFractal();
  767.         }
  768.         else
  769.             return;
  770.     }
  771.     else
  772.     {
  773.         bFilter26 = FALSE;
  774.         if (nFilter == 26)
  775.             nFilter = 0;
  776.         GoDoFractal();
  777.     }
  778. }
  779.  
  780. void CIterationsView::OnUpdateFilter26(CCmdUI* pCmdUI) 
  781. {
  782.     pCmdUI->SetCheck(bFilter26 && nFilter);
  783. }
  784.  
  785.  
  786. void CIterationsView::OnFractalMfilter() 
  787. {
  788.     // Monster Filter
  789.     if (bMFilter) 
  790.     {
  791.         bMFilter = FALSE;
  792.         if (nFilter == 27)
  793.             nFilter = 0;
  794.  
  795.         GoDoFractal();
  796.     }
  797.     else
  798.     {
  799.         // Create X and Y Temp Arrays for Multi-Fractals
  800.         bMFilter = TRUE;
  801.         if (!nFilter)
  802.             nFilter = 27;
  803.         GoDoFractal();
  804.     }
  805. }
  806.  
  807. void CIterationsView::OnUpdateFractalMfilter(CCmdUI* pCmdUI) 
  808. {
  809.     if (bMFilter && nFilter != 29)    pCmdUI->SetCheck(TRUE);
  810.     else pCmdUI->SetCheck(FALSE);
  811. }
  812.  
  813. void CIterationsView::OnFilter28() 
  814. {
  815.     // Quick mode checks delta z < 1e-4,
  816.     // If true, assume iteration never escapes
  817.     if (bQuickMode) 
  818.     {
  819.         bQuickMode = FALSE;
  820.         if (nFilter == 28)
  821.             nFilter = 0;
  822.  
  823.         GoDoFractal();
  824.     }
  825.     else
  826.     {
  827.         CRW1 rw;
  828.         rw.m_RW1_n = dF28;
  829.         if (rw.DoModal() == IDOK)
  830.         {
  831.             bQuickMode = TRUE;
  832.             if (!nFilter)
  833.                 nFilter = 28;
  834.             dF28 = rw.m_RW1_n;
  835.             GoDoFractal();
  836.         }
  837.     }
  838. }
  839.  
  840. void CIterationsView::OnUpdateFilter28(CCmdUI* pCmdUI) 
  841. {
  842.     if (bQuickMode)    pCmdUI->SetCheck(TRUE);
  843.     else pCmdUI->SetCheck(FALSE);
  844. }
  845.  
  846. void CIterationsView::OnFilter29() 
  847. {
  848.     // Turn off Fractal Dimension calculation (if it is on)
  849.     nFDOption = 0;
  850.     if (nFilter == 29)
  851.     {
  852.         bMFilter = FALSE;
  853.         nFilter = 0;
  854.     }
  855.     GoDoFractal();
  856. }
  857.  
  858. void CIterationsView::OnUpdateFilter29(CCmdUI* pCmdUI) 
  859. {
  860.     if (nFilter == 29 && bMFilter && nFDOption == 0)    
  861.         pCmdUI->SetCheck(TRUE);
  862.     else pCmdUI->SetCheck(FALSE);
  863. }
  864.  
  865. void CIterationsView::OnFilter30() 
  866. {
  867.     nFilter = 130;
  868.     GoDoFractal();
  869. }
  870.  
  871. void CIterationsView::OnUpdateFilter30(CCmdUI* pCmdUI) 
  872. {
  873.     if (nFilter == 130)    pCmdUI->SetCheck(TRUE);
  874.     else pCmdUI->SetCheck(FALSE);
  875. }
  876.  
  877. void CIterationsView::OnFilter31() 
  878. {
  879.     nFilter = 131;
  880.     GoDoFractal();
  881. }
  882.  
  883. void CIterationsView::OnUpdateFilter31(CCmdUI* pCmdUI) 
  884. {
  885.     if (nFilter == 131)    pCmdUI->SetCheck(TRUE);
  886.     else pCmdUI->SetCheck(FALSE);
  887. }
  888.  
  889. void CIterationsView::OnFilter32() 
  890. {
  891.     nFilter = 132;
  892.     GoDoFractal();
  893. }
  894.  
  895. void CIterationsView::OnUpdateFilter32(CCmdUI* pCmdUI) 
  896. {
  897.     if (nFilter == 132)    pCmdUI->SetCheck(TRUE);
  898.     else pCmdUI->SetCheck(FALSE);
  899. }
  900.  
  901. void CIterationsView::OnFilter33() 
  902. {
  903.     nFilter = 133;
  904.     GoDoFractal();
  905. }
  906.  
  907. void CIterationsView::OnUpdateFilter33(CCmdUI* pCmdUI) 
  908. {
  909.     if (nFilter == 133)    pCmdUI->SetCheck(TRUE);
  910.     else pCmdUI->SetCheck(FALSE);
  911. }
  912.  
  913. void CIterationsView::OnFilter34() 
  914. {
  915.     nFilter = 134;
  916.     GoDoFractal();
  917. }
  918.  
  919. void CIterationsView::OnUpdateFilter34(CCmdUI* pCmdUI) 
  920. {
  921.     if (nFilter == 134)    pCmdUI->SetCheck(TRUE);
  922.     else pCmdUI->SetCheck(FALSE);
  923. }
  924.  
  925. void CIterationsView::OnFilter35() 
  926. {
  927.     nFilter = 135;
  928.     GoDoFractal();
  929. }
  930.  
  931. void CIterationsView::OnUpdateFilter35(CCmdUI* pCmdUI) 
  932. {
  933.     if (nFilter == 135)    pCmdUI->SetCheck(TRUE);
  934.     else pCmdUI->SetCheck(FALSE);
  935. }
  936.  
  937. void CIterationsView::OnFilter36() 
  938. {
  939.     nFilter = 136;
  940.     GoDoFractal();
  941. }
  942.  
  943. void CIterationsView::OnUpdateFilter36(CCmdUI* pCmdUI) 
  944. {
  945.     if (nFilter == 136)    pCmdUI->SetCheck(TRUE);
  946.     else pCmdUI->SetCheck(FALSE);
  947. }
  948.  
  949. void CIterationsView::OnFilter37() 
  950. {
  951.     nFilter = 137;
  952.     GoDoFractal();
  953. }
  954.  
  955. void CIterationsView::OnUpdateFilter37(CCmdUI* pCmdUI) 
  956. {
  957.     if (nFilter == 137)    pCmdUI->SetCheck(TRUE);
  958.     else pCmdUI->SetCheck(FALSE);
  959. }
  960.  
  961. void CIterationsView::OnFilter38() 
  962. {
  963.     nFilter = 138;
  964.     GoDoFractal();
  965. }
  966.  
  967. void CIterationsView::OnUpdateFilter38(CCmdUI* pCmdUI) 
  968. {
  969.     if (nFilter == 138)    pCmdUI->SetCheck(TRUE);
  970.     else pCmdUI->SetCheck(FALSE);
  971. }
  972.  
  973. void CIterationsView::OnFilter39() 
  974. {
  975.     nFilter = 139;
  976.     GoDoFractal();
  977. }
  978.  
  979. void CIterationsView::OnUpdateFilter39(CCmdUI* pCmdUI) 
  980. {
  981.     if (nFilter == 139)    pCmdUI->SetCheck(TRUE);
  982.     else pCmdUI->SetCheck(FALSE);
  983. }
  984.  
  985. void CIterationsView::OnFilter40() 
  986. {
  987.     nFilter = 140;
  988.     GoDoFractal();
  989. }
  990.  
  991. void CIterationsView::OnUpdateFilter40(CCmdUI* pCmdUI) 
  992. {
  993.     if (nFilter == 140)    pCmdUI->SetCheck(TRUE);
  994.     else pCmdUI->SetCheck(FALSE);
  995. }
  996.  
  997. void CIterationsView::OnFilter41() 
  998. {
  999.     nFilter = 141;
  1000.     GoDoFractal();
  1001. }
  1002.  
  1003. void CIterationsView::OnUpdateFilter41(CCmdUI* pCmdUI) 
  1004. {
  1005.     if (nFilter == 141)    pCmdUI->SetCheck(TRUE);
  1006.     else pCmdUI->SetCheck(FALSE);
  1007. }
  1008.  
  1009. void CIterationsView::OnFilter42() 
  1010. {
  1011.     nFilter = 142;
  1012.     GoDoFractal();
  1013. }
  1014.  
  1015. void CIterationsView::OnUpdateFilter42(CCmdUI* pCmdUI) 
  1016. {
  1017.     if (nFilter == 142)    pCmdUI->SetCheck(TRUE);
  1018.     else pCmdUI->SetCheck(FALSE);
  1019. }
  1020.  
  1021. void CIterationsView::OnFilter43() 
  1022. {
  1023.     nFilter = 143;
  1024.     GoDoFractal();
  1025. }
  1026.  
  1027. void CIterationsView::OnUpdateFilter43(CCmdUI* pCmdUI) 
  1028. {
  1029.     if (nFilter == 143)    pCmdUI->SetCheck(TRUE);
  1030.     else pCmdUI->SetCheck(FALSE);
  1031. }
  1032.  
  1033. void CIterationsView::OnFilter244() 
  1034. {
  1035.     nFilter = 144;
  1036.     GoDoFractal();    
  1037. }
  1038.  
  1039. void CIterationsView::OnUpdateFilter244(CCmdUI* pCmdUI) 
  1040. {
  1041.     if (nFilter == 144)    pCmdUI->SetCheck(TRUE);
  1042.     else pCmdUI->SetCheck(FALSE);
  1043. }
  1044.  
  1045. void CIterationsView::OnFilter245() 
  1046. {
  1047.     nFilter = 145;
  1048.     GoDoFractal();    
  1049. }
  1050.  
  1051. void CIterationsView::OnUpdateFilter245(CCmdUI* pCmdUI) 
  1052. {
  1053.     if (nFilter == 145)    pCmdUI->SetCheck(TRUE);
  1054.     else pCmdUI->SetCheck(FALSE);
  1055. }
  1056.  
  1057. void CIterationsView::OnFilter46() 
  1058. {
  1059.     nFilter = 146;
  1060.     GoDoFractal();    
  1061. }
  1062.  
  1063. void CIterationsView::OnUpdateFilter46(CCmdUI* pCmdUI) 
  1064. {
  1065.     if (nFilter == 146)    pCmdUI->SetCheck(TRUE);
  1066.     else pCmdUI->SetCheck(FALSE);
  1067. }
  1068.  
  1069. void CIterationsView::OnFilter47() 
  1070. {
  1071.     nFilter = 147;
  1072.     GoDoFractal();    
  1073. }
  1074.  
  1075. void CIterationsView::OnUpdateFilter47(CCmdUI* pCmdUI) 
  1076. {
  1077.     if (nFilter == 147)    pCmdUI->SetCheck(TRUE);
  1078.     else pCmdUI->SetCheck(FALSE);
  1079. }
  1080.  
  1081. ///////////////////////////////////////////////////////////
  1082. void CIterationsView::OnOptions30() 
  1083. {
  1084.     nFilter = 30;
  1085.     GoDoFractal();
  1086. }
  1087.  
  1088. void CIterationsView::OnUpdateOptions30(CCmdUI* pCmdUI) 
  1089. {
  1090.     if (nFilter == 30)    pCmdUI->SetCheck(TRUE);
  1091.     else pCmdUI->SetCheck(FALSE);
  1092. }
  1093.  
  1094. void CIterationsView::OnOptions31() 
  1095. {
  1096.     if (bFilter31) 
  1097.     {
  1098.         bFilter31 = FALSE;
  1099.         if (nFilter == 31)
  1100.             nFilter = 0;
  1101.  
  1102.         GoDoFractal();
  1103.     }
  1104.     else
  1105.     {
  1106.         bFilter31 = TRUE;
  1107.         if (!nFilter)
  1108.             nFilter = 31;
  1109.         bGeometry = TRUE;
  1110.         GoDoFractal();
  1111.     }
  1112. }
  1113.  
  1114. void CIterationsView::OnUpdateOptions31(CCmdUI* pCmdUI) 
  1115. {
  1116.     pCmdUI->SetCheck(bFilter31);
  1117. }
  1118.  
  1119. void CIterationsView::OnOptions32() 
  1120. {
  1121.     if (bFilter32) 
  1122.     {
  1123.         bFilter32 = FALSE;
  1124.         if (nFilter == 32)
  1125.             nFilter = 0;
  1126.  
  1127.         GoDoFractal();
  1128.     }
  1129.     else
  1130.     {
  1131.         bFilter32 = TRUE;
  1132.         if (!nFilter)
  1133.             nFilter = 32;
  1134.         bGeometry = TRUE;
  1135.         GoDoFractal();
  1136.     }
  1137. }
  1138.  
  1139. void CIterationsView::OnUpdateOptions32(CCmdUI* pCmdUI) 
  1140. {
  1141.     pCmdUI->SetCheck(bFilter32);
  1142. }
  1143.  
  1144. void CIterationsView::OnOptions33() 
  1145. {
  1146.     if (bFilter33) 
  1147.     {
  1148.         bFilter33 = FALSE;
  1149.         if (nFilter == 33)
  1150.             nFilter = 0;
  1151.  
  1152.         GoDoFractal();
  1153.     }
  1154.     else
  1155.     {
  1156.         bFilter33 = TRUE;
  1157.         if (!nFilter)
  1158.             nFilter = 33;
  1159.         bGeometry = TRUE;
  1160.         GoDoFractal();
  1161.     }
  1162. }
  1163.  
  1164. void CIterationsView::OnUpdateOptions33(CCmdUI* pCmdUI) 
  1165. {
  1166.     pCmdUI->SetCheck(bFilter33);
  1167. }
  1168.  
  1169. void CIterationsView::OnOptions34() 
  1170. {
  1171.     if (bFilter34) 
  1172.     {
  1173.         bFilter34 = FALSE;
  1174.         if (nFilter == 34)
  1175.             nFilter = 0;
  1176.  
  1177.         GoDoFractal();
  1178.     }
  1179.     else
  1180.     {
  1181.         bFilter34 = TRUE;
  1182.         if (!nFilter)
  1183.             nFilter = 34;
  1184.         bGeometry = TRUE;
  1185.         GoDoFractal();
  1186.     }
  1187. }
  1188.  
  1189. void CIterationsView::OnUpdateOptions34(CCmdUI* pCmdUI) 
  1190. {
  1191.     pCmdUI->SetCheck(bFilter34);
  1192. }
  1193.  
  1194. void CIterationsView::OnOptions35() 
  1195. {
  1196.     if (bFilter35) 
  1197.     {
  1198.         bFilter35 = FALSE;
  1199.         if (nFilter == 35)
  1200.             nFilter = 0;
  1201.  
  1202.         GoDoFractal();
  1203.     }
  1204.     else
  1205.     {
  1206.         bFilter35 = TRUE;
  1207.         if (!nFilter)
  1208.             nFilter = 35;
  1209.         bGeometry = TRUE;
  1210.         GoDoFractal();
  1211.     }
  1212. }
  1213.  
  1214. void CIterationsView::OnUpdateOptions35(CCmdUI* pCmdUI) 
  1215. {
  1216.     pCmdUI->SetCheck(bFilter35);
  1217. }
  1218.  
  1219. void CIterationsView::OnOptions36() 
  1220. {
  1221.     if (bFilter36) 
  1222.     {
  1223.         bFilter36 = FALSE;
  1224.         if (nFilter == 36)
  1225.             nFilter = 0;
  1226.  
  1227.         GoDoFractal();
  1228.     }
  1229.     else
  1230.     {
  1231.         bFilter36 = TRUE;
  1232.         if (!nFilter)
  1233.             nFilter = 36;
  1234.         bGeometry = TRUE;
  1235.         GoDoFractal();
  1236.     }
  1237. }
  1238.  
  1239. void CIterationsView::OnUpdateOptions36(CCmdUI* pCmdUI) 
  1240. {
  1241.     pCmdUI->SetCheck(bFilter36);
  1242. }
  1243.  
  1244. void CIterationsView::OnOptions37() 
  1245. {
  1246.     if (bFilter37) 
  1247.     {
  1248.         bFilter37 = FALSE;
  1249.         if (nFilter == 37)
  1250.             nFilter = 0;
  1251.  
  1252.         GoDoFractal();
  1253.     }
  1254.     else
  1255.     {
  1256.         bFilter37 = TRUE;
  1257.         if (!nFilter)
  1258.             nFilter = 37;
  1259.         bGeometry = TRUE;
  1260.         GoDoFractal();
  1261.     }
  1262. }
  1263.  
  1264. void CIterationsView::OnUpdateOptions37(CCmdUI* pCmdUI) 
  1265. {
  1266.     pCmdUI->SetCheck(bFilter37 && nFilter);
  1267. }
  1268.  
  1269. void CIterationsView::OnOptions38() 
  1270. {
  1271.     if (bFilter38) 
  1272.     {
  1273.         bFilter38 = FALSE;
  1274.         if (nFilter == 38)
  1275.             nFilter = 0;
  1276.  
  1277.         GoDoFractal();
  1278.     }
  1279.     else
  1280.     {
  1281.         bFilter38 = TRUE;
  1282.         if (!nFilter)
  1283.             nFilter = 38;
  1284.         bGeometry = TRUE;
  1285.         GoDoFractal();
  1286.     }
  1287. }
  1288.  
  1289. void CIterationsView::OnUpdateOptions38(CCmdUI* pCmdUI) 
  1290. {
  1291.     pCmdUI->SetCheck(bFilter38 && nFilter);
  1292. }
  1293.  
  1294. ////////////////////////////////////////////////////////
  1295. // Fractal Dimension Options
  1296. ////////////////////////////////////////////////////////
  1297.  
  1298. void CIterationsView::OnOptions1() 
  1299. {
  1300.     // Fractal Dimension
  1301.     nFDOption = 1;
  1302.     bMFilter = TRUE;
  1303.     nFilter = 29;
  1304.     GoDoFractal();
  1305. }
  1306.  
  1307. void CIterationsView::OnUpdateOptions1(CCmdUI* pCmdUI) 
  1308. {
  1309.     if (nFilter == 29 && bMFilter && nFDOption == 1)    
  1310.         pCmdUI->SetCheck(TRUE);
  1311.     else pCmdUI->SetCheck(FALSE);
  1312. }
  1313.  
  1314. void CIterationsView::OnOptions2() 
  1315. {
  1316.     // Fractal Dimension
  1317.     nFDOption = 2;
  1318.     bMFilter = TRUE;
  1319.     nFilter = 29;
  1320.     GoDoFractal();
  1321. }
  1322.  
  1323. void CIterationsView::OnUpdateOptions2(CCmdUI* pCmdUI) 
  1324. {
  1325.     if (nFilter == 29 && bMFilter && nFDOption == 2)    
  1326.         pCmdUI->SetCheck(TRUE);
  1327.     else pCmdUI->SetCheck(FALSE);
  1328. }
  1329.  
  1330. void CIterationsView::OnOptions3() 
  1331. {
  1332.     // Fractal Dimension
  1333.     nFDOption = 3;
  1334.     bMFilter = TRUE;
  1335.     nFilter = 29;
  1336.     GoDoFractal();
  1337. }
  1338.  
  1339. void CIterationsView::OnUpdateOptions3(CCmdUI* pCmdUI) 
  1340. {
  1341.     if (nFilter == 29 && bMFilter && nFDOption == 3)    
  1342.         pCmdUI->SetCheck(TRUE);
  1343.     else pCmdUI->SetCheck(FALSE);
  1344. }
  1345.  
  1346. void CIterationsView::OnOptions4() 
  1347. {
  1348.     // Fractal Dimension
  1349.     nFDOption = 4;
  1350.     bMFilter = TRUE;
  1351.     nFilter = 29;
  1352.     GoDoFractal();
  1353. }
  1354.  
  1355. void CIterationsView::OnUpdateOptions4(CCmdUI* pCmdUI) 
  1356. {
  1357.     if (nFilter == 29 && bMFilter && nFDOption == 4)    
  1358.         pCmdUI->SetCheck(TRUE);
  1359.     else pCmdUI->SetCheck(FALSE);
  1360. }
  1361.  
  1362. void CIterationsView::OnOptions5() 
  1363. {
  1364.     // Fractal Dimension
  1365.     nFDOption = 5;
  1366.     bMFilter = TRUE;
  1367.     nFilter = 29;
  1368.     GoDoFractal();
  1369. }
  1370.  
  1371. void CIterationsView::OnUpdateOptions5(CCmdUI* pCmdUI) 
  1372. {
  1373.     if (nFilter == 29 && bMFilter && nFDOption == 5)    
  1374.         pCmdUI->SetCheck(TRUE);
  1375.     else pCmdUI->SetCheck(FALSE);
  1376. }
  1377.  
  1378. void CIterationsView::OnOptions6() 
  1379. {
  1380.     // Fractal Dimension
  1381.     nFDOption = 6;
  1382.     bMFilter = TRUE;
  1383.     nFilter = 29;
  1384.     GoDoFractal();
  1385. }
  1386.  
  1387. void CIterationsView::OnUpdateOptions6(CCmdUI* pCmdUI) 
  1388. {
  1389.     if (nFilter == 29 && bMFilter && nFDOption == 6)    
  1390.         pCmdUI->SetCheck(TRUE);
  1391.     else pCmdUI->SetCheck(FALSE);
  1392. }
  1393.  
  1394.  
  1395. void CIterationsView::OnOptions7() 
  1396. {
  1397.     // Fractal Dimension
  1398.     nFDOption = 7;
  1399.     bMFilter = TRUE;
  1400.     nFilter = 29;
  1401.     GoDoFractal();
  1402. }
  1403.  
  1404. void CIterationsView::OnUpdateOptions7(CCmdUI* pCmdUI) 
  1405. {
  1406.     if (nFilter == 29 && bMFilter && nFDOption == 7)    
  1407.         pCmdUI->SetCheck(TRUE);
  1408.     else pCmdUI->SetCheck(FALSE);
  1409. }
  1410.  
  1411. void CIterationsView::OnOptions8() 
  1412. {
  1413.     // Fractal Dimension
  1414.     nFDOption = 8;
  1415.     bMFilter = TRUE;
  1416.     nFilter = 29;
  1417.     GoDoFractal();
  1418. }
  1419.  
  1420. void CIterationsView::OnUpdateOptions8(CCmdUI* pCmdUI) 
  1421. {
  1422.     if (nFilter == 29 && bMFilter && nFDOption == 8)    
  1423.         pCmdUI->SetCheck(TRUE);
  1424.     else pCmdUI->SetCheck(FALSE);
  1425. }
  1426.  
  1427. void CIterationsView::OnOptions9() 
  1428. {
  1429.     // Fractal Dimension
  1430.     nFDOption = 9;
  1431.     bMFilter = TRUE;
  1432.     nFilter = 29;
  1433.     GoDoFractal();
  1434. }
  1435.  
  1436. void CIterationsView::OnUpdateOptions9(CCmdUI* pCmdUI) 
  1437. {
  1438.     if (nFilter == 29 && bMFilter && nFDOption == 9)    
  1439.         pCmdUI->SetCheck(TRUE);
  1440.     else pCmdUI->SetCheck(FALSE);
  1441. }
  1442.  
  1443. void CIterationsView::OnOptions10() 
  1444. {
  1445.     // Fractal Dimension
  1446.     nFDOption = 10;
  1447.     bMFilter = TRUE;
  1448.     nFilter = 29;
  1449.     GoDoFractal();
  1450. }
  1451.  
  1452. void CIterationsView::OnUpdateOptions10(CCmdUI* pCmdUI) 
  1453. {
  1454.     if (nFilter == 29 && bMFilter && nFDOption == 10)    
  1455.         pCmdUI->SetCheck(TRUE);
  1456.     else pCmdUI->SetCheck(FALSE);
  1457. }
  1458.  
  1459. /////////////////////////////////////////////////////////////////////////
  1460. // Biomorphs
  1461. /////////////////////////////////////////////////////////////////////////
  1462.  
  1463. void CIterationsView::OnUpdateFractalBiomorphnone(CCmdUI* pCmdUI) 
  1464. {
  1465.     if (dBiomorph == 0)
  1466.         pCmdUI->SetCheck(TRUE);
  1467.     else
  1468.         pCmdUI->SetCheck(FALSE);
  1469. }
  1470.  
  1471. void CIterationsView::OnFractal1biomorphxory() 
  1472. {
  1473.     dBiomorph = 1;
  1474.     bDraw = TRUE;
  1475.     bLaunch = FALSE;
  1476. }
  1477.  
  1478. void CIterationsView::OnUpdateFractal1biomorphxory(CCmdUI* pCmdUI) 
  1479. {
  1480.     if (dBiomorph == 1)
  1481.         pCmdUI->SetCheck(TRUE);
  1482.     else
  1483.         pCmdUI->SetCheck(FALSE);
  1484. }
  1485.  
  1486. void CIterationsView::OnFractalBiomorph() 
  1487. {
  1488.     dBiomorph = 2;
  1489.     bDraw = TRUE;
  1490.     bLaunch = FALSE;
  1491. }
  1492.  
  1493. void CIterationsView::OnUpdateFractalBiomorph(CCmdUI* pCmdUI) 
  1494. {
  1495.     if (dBiomorph == 2)
  1496.         pCmdUI->SetCheck(TRUE);
  1497.     else
  1498.         pCmdUI->SetCheck(FALSE);
  1499. }
  1500.  
  1501. void CIterationsView::OnFractalBiomorphtestxory() 
  1502. {
  1503.     dBiomorph = 3;
  1504.     bDraw = TRUE;
  1505.     bLaunch = FALSE;
  1506. }
  1507.  
  1508. void CIterationsView::OnUpdateFractalBiomorphtestxory(CCmdUI* pCmdUI) 
  1509. {
  1510.     if (dBiomorph == 3)
  1511.         pCmdUI->SetCheck(TRUE);
  1512.     else
  1513.         pCmdUI->SetCheck(FALSE);
  1514. }
  1515.  
  1516. void CIterationsView::PostProcess()
  1517. {
  1518.     i_Post = i;
  1519.  
  1520.     bPostFractal            = TRUE;
  1521.     nDistortion_save    = nDistortion;
  1522.     nDistortion                = nPostFractal;
  1523.     bPostProcess            = FALSE;
  1524.     cOrient_save            = cOrient;
  1525.     cOrient                        = cPostOrient;
  1526.  
  1527.     TestPatternSub();
  1528.  
  1529.     cOrient                        = cOrient_save;    
  1530.     bPostProcess            = TRUE;
  1531.     bPostFractal            = FALSE;
  1532.     nDistortion                = nDistortion_save;
  1533.  
  1534.     //if (i < i_Post)     // Maximum
  1535.     //    i = i_Post;
  1536.  
  1537.     i += i_Post;
  1538.     if (i >= NMAX) i %= (JMAX);
  1539. }
  1540.  
  1541. void CIterationsView::OnOptionsPostfractal() 
  1542. {
  1543.     if (bPostProcess)
  1544.     {
  1545.         bPostProcess = FALSE;
  1546.         GoDoFractal();
  1547.     }
  1548.     else
  1549.     {
  1550.         CPost post;
  1551.         post.m_Post = nPostFractal;
  1552.         if (post.DoModal() == IDOK)
  1553.         {
  1554.             nPostFractal = post.m_Post;    
  1555.             bPostProcess = TRUE;
  1556.             
  1557.             COrient co;
  1558.             co.m_Real = cPostOrient.real();
  1559.             co.m_Imag = cPostOrient.imag();
  1560.             if (co.DoModal() == IDOK)
  1561.             {
  1562.                 cPostOrient.set_real(co.m_Real);
  1563.                 cPostOrient.set_imag(co.m_Imag);
  1564.             }    
  1565.             GoDoFractal();
  1566.         }
  1567.     }
  1568. }
  1569.  
  1570. void CIterationsView::OnUpdateOptionsPostfractal(CCmdUI* pCmdUI) 
  1571. {
  1572.     pCmdUI->SetCheck(bPostProcess);    
  1573. }
  1574.  
  1575. void CIterationsView::PreCombo()
  1576. {
  1577.     nDistortion_save    = nDistortion;
  1578.     nDistortion                = nPostFractal;
  1579.     bPostFractal            = TRUE;
  1580.  
  1581.     TestEquations();
  1582.  
  1583.     bPostFractal            = FALSE;
  1584.     nDistortion                = nDistortion_save;
  1585. }
  1586.  
  1587. void CIterationsView::OnOptionsCombo() 
  1588. {
  1589.     CPost post;
  1590.     post.m_Post = nPostFractal;
  1591.     if (post.DoModal() == IDOK)
  1592.     {
  1593.         nPostFractal = post.m_Post;    
  1594.         bCombo = TRUE;
  1595.         if (nPreFractal == 0)
  1596.             nPreFractal = 1;
  1597.         
  1598.         GoDoFractal();
  1599.     }
  1600. }
  1601.  
  1602. void CIterationsView::OnUpdateOptionsCombo(CCmdUI* pCmdUI) 
  1603. {
  1604.     pCmdUI->SetCheck(bCombo);    
  1605. }
  1606.